<?php 
                    
function get_real_value($item)
{
    $money = unserialize($item);
    return Yii::app()->numberFormatter->format('###,###,###,###', $money['payment']) . ' VNĐ';
     
}
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'supplies-import-grid',
    'dataProvider'=>$model,
    //'filter'=>$model,
    'summaryText' => 'Tổng tiền : '. Yii::app()->numberFormatter->format('###,###', $money_import) .'VNĐ. Hiển thị kết quả từ {start} - {end}.' ,
    'afterAjaxUpdate'=>'function(id,data){ 
        $(".items tr td a").click(function(){
           $("#hidden_div").empty().load($(this).attr("href")).dialog({modal : true});
           return false;
        });        
    }',
    'columns'=>array(
    
    array(
        'name' => 'time',
        'value' => 'date("d-m-Y",strtotime($data->time))'                        
    ),
    array(
        'name' => 'Tiền',
		'type'=>'raw',
         'value' => 'CHtml::link(CHtml::encode(get_real_value($data->data)),array("detail","id"=>$data->id))',
    ),
    )
)); 
?> 
<script type="text/javascript">
$().ready(function(){
    $(".items tr td a").click(function(){
       $("#hidden_div").empty().load($(this).attr("href")).dialog({modal : true});
       return false;
    });
});
</script>